package edu.sctu.practice.class01.zhengsenwen.assign.assign03.test01;

import edu.sctu.practice.class01.zhengsenwen.JavaLesson.firstday.Constant;

/**
 * Created by zhengsenwen on 2015/10/22.
 */
public class Circle extends GeometricObject {
    //  （2）Circle类和Rectangle类是GeometricObject类的子类，其中应实现父类的抽象方法。
    // findArea和findPerimeter，抽象方法findArea求图形面积，抽象方法findPerimeter求图形周长。
    public float redius = 0.0f;
    public float area = 0.0f;
    public float perimeter = 0.0f;

    public Circle(String color) {
        super(color);
    }

    public Circle(String color, float redius) {
        super(color);
        this.redius = redius;
    }
    @Override
    public float findArea() {
        area = Constant.PI * redius * redius;
        System.out.print("area = ");
        return area;
    }
    @Override
    public float findPerimeter() {
        perimeter = Constant.PI * redius * 2;
        System.out.print("perimeter = ");
        return perimeter;
    }
}
